﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace BookOnline.Data
{
    public class AuthorController:GetData
    {
        public DataSet AuthorSelectAll()
        {
            string procName = "dbo.AuthorSelectAll";
            DataSet ds = ExcuteProc(procName);
            return ds;
        }
        public int AuthorInsert(int AuthorID,string AuthorName,string AuthorPhone,string AuthorAddress)
        {
            string procName = "dbo.AuthorInsert";
            SqlParameter[] arrParam = new SqlParameter[4];
            arrParam[0] = new SqlParameter("@AuthorID", AuthorID);
            arrParam[1] = new SqlParameter("@AuthorName", AuthorName);
            arrParam[2] = new SqlParameter("@AuthorPhone", AuthorPhone);
            arrParam[3] = new SqlParameter("@AuthorAddress", AuthorAddress);
            return ExcuteProc(procName, arrParam);
        }
    }
}
